{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "price    0.020083\nvol      0.397420\ndtype: float64\n"
     ]
    }
   ],
   "source": [
    "from pytdx.hq import TdxHq_API\n",
    "from pytdx.util.best_ip import select_best_ip\n",
    "from pytdx.params import TDXParams\n",
    "from tdx.utils.round import precise_round\n",
    "\n",
    "api = TdxHq_API()\n",
    "api.connect(select_best_ip())\n",
    "df = api.get_minute_time_data(1,'603559')\n",
    "fs = api.to_df(df)\n",
    "diff = (fs / fs.shift(1) - 1)\n",
    "print(diff[-5:].sum())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "price    0.0255\nvol      6.6681\ndtype: float64\n"
     ]
    }
   ],
   "source": [
    ""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    ""
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2.0
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}